fix(assertion-monitor): use batch data to prevent false positive alerts#92
Open
fix(assertion-monitor): use batch data to prevent false positive alerts#92
Conversation
Changed assertion monitor to only alert when batches have been posted but not asserted, instead of alerting on any block production without recent assertions. This eliminates false positives on low-activity chains where blocks are produced but no batches are posted. Changes: - Query sequencerReportedSubMessageCount() from Bridge contract - Replace block-based check with batch-aware check - Remove redundant "No recent node creation events" alert - Add error handling for batch query (fail-safe to no alert) Fixes false positives on: Humanity Mainnet, Galactica Mainnet
2ab2881 to
0a41c25
Compare
| chainState.childLatestCreatedBlock = { | ||
| ...chainState.childLatestCreatedBlock!, | ||
| timestamp: NOW - BigInt(5 * 60 * 60), // 5 hours ago | ||
| number: 900n, |
Contributor
There was a problem hiding this comment.
Where are these 900n and 1000n (just after this) values coming from?
Contributor
Author
There was a problem hiding this comment.
they're just arbitrary for the test.
all that matters is that 900 < 1000.
i added comments in the test code to clarify.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Improve assertion monitoring accuracy by alerting only when batches exist that haven't been asserted, instead of alerting on any block production.
Key insight: Per Arbitrum docs, "if no new batches are posted, no new assertions will be posted." Validators assert batches, not raw blocks.
Changes
sequencerReportedSubMessageCount()from Bridge contract to get last block included in a batchlastBlockIncludedInBatch > childLatestCreatedBlock)lastBlockIncludedInBatchfield toChainStateResults
Tested against 27 production Orbit chains (parallel run, same chain state):
Note: Humanity/Galactica showing healthy is due to portal's rollup address fix (657bc7b2), not this change.
Test plan
yarn workspace assertion-monitor buildpassesyarn workspace assertion-monitor testpasses (25 tests)